<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="common/include :: header('修改客户信息')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-employee-edit" th:object="${employee}">
        <input id="employeeId" name="employeeId" type="hidden" th:field="*{id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">员工姓名：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="name" id="employeeName" th:field="*{name}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">员工邮箱：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="email" id="email" th:field="*{email}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">员工年龄：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="age" id="age" th:field="*{age}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">是否超管：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict: ${@dict.getType('emp_admin')}">
                    <input type="radio" name="admin" th:id="${dict.id}"
                           th:value="${dict.value}" th:checked="${dict.isDefault}" th:field="*{admin}" required>
                    <label th:for="${dict.id}" th:text="${dict.label}">
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">所在部门：</label>


            <div class="col-sm-6">
                <select class="form-control" type="text" name="deptId" id="deptId" required>
                    <option th:each="dept: ${dept}" th:text="${dept.name}" th:value="${dept.id}" th:field="*{deptId}">
                </select>
            </div>
        </div>
    </form>
</div>
<th:block th:include="common/include :: footer"/>
<script type="text/javascript">
    var prefix = ctx + "/business/employee";

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-employee-edit').serialize());
        }
    }
</script>
</body>
</html>
